const { validation } = require('../../util/auth')
module.exports = [
  {
    /**
    * @api {get} /weapp/user [微信小程序登录鉴权]
    * @apiGroup Weapp
    * @apiPermission none
    * @apiDescription 微信小程序登录鉴权
    * @apiHeader {String} x-wx-skey
    */
    url: '/weapp/user',
    method: 'get',
    request: (req, res) => {
      validation(req).then(result => {
        res.json({
          code: 0,
          data: result
        })
      }).catch(err => {
        res.json({ code: -1, err })
      })
    }
  }
]
